package zy.wq.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import zy.wq.common.InvocationResult;
import zy.wq.security.bean.SystemUser;
import zy.wq.security.service.SystemUserService;

@RestController
public class UserController {
	
	
	@Autowired
	SystemUserService userService;
	
	
	
	@PostMapping("/register")
	public InvocationResult Register(String userName,String password){
		SystemUser u=new SystemUser();
		u.setName(userName);
        u.setPassword(password);
		this.userService.addUser(u);
		return new InvocationResult("SUCCESS");
		
	}
	

}
